package com.app.coffeephilosophy.activity;

import com.app.coffeephilosophy.R;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;
import android.widget.TextView;

public class CoffeeCharacterActivity extends Activity {
    private Button chracterback;
    private TextView textcharacter;
    private int type;
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
				WindowManager.LayoutParams.FLAG_FULLSCREEN); // 设置全屏模式
		requestWindowFeature(Window.FEATURE_NO_TITLE); // 去除标题栏
		setContentView(R.layout.coffeecharacter);
		chracterback=(Button)this.findViewById(R.id.characterback);
		textcharacter=(TextView)this.findViewById(R.id.charactertext);
		setListener();
		setData();
	}
	
	public void setListener(){
		chracterback.setOnClickListener(new OnClickListener(){

			 
			public void onClick(View v) {
				finish();
			}
			
		});
		
	}
	
	public void setData(){
		
		String[] characters=(String[])this.getResources().getStringArray(R.array.characters);
		Intent intent=getIntent();
		int imageId = intent.getIntExtra("id", R.drawable.lanshan_big);
		type = intent.getIntExtra("type", 0);
		switch (type) {		
		case 1:			
			textcharacter.setText(characters[imageId]);
			break;
		case 2:
			textcharacter.setText(characters[imageId]);
			break;
		case 3:
			textcharacter.setText(characters[imageId]);
			break;
		}
	}
}
